<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%     
	String path = request.getContextPath();     
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";     
%> 
<%response.setHeader("cache-control","public"); %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>个人首页</title>
	<base href="<%=basePath%>"/>
  	<%@ include file="../list_include.jsp"%>
	<link rel="stylesheet" href="css/themes/1.8/start/jquery-ui-1.8.5.custom.css" />
    <link rel="stylesheet" href="css/jquery.portlet.css?v=1.1.3" />
    
    <style type="text/css"> 
		li {margin:15 0 15 0; padding:0;}
  	</style>
    
    <script src="js/jquery-ui-1.8.14.custom.min.js" type="text/javascript"></script>
    <script src="js/jquery.layout.js" type="text/javascript"></script>
    <script src="js/jquery.portlet.js?v=1.1.3"></script>
    <script type="text/javascript">
    	
		$(function() {
			var str = '<div style="width: 100%; float: left;"><ul>';
	    	<c:forEach var="news" items="${newsList}" varStatus="status">
	    		str = str +'<li style="margin: 15px 0 15px 0;"><a style="font-size:12px; text-decoration: none;" href="comprehensive/news/newsview.do?id=<c:out value="${news.id}"></c:out>">';
	    		str = str +'<c:out value="${fn:substring(news.title,0,23)}${fn:length(news.title)>25?'...':''}"></c:out>';
	    		str = str +'</a></li>';
			</c:forEach>
			str = str+'</ul></div><div style="float: right;"><a style="font-size:10pt;" href="comprehensive/news/newslist.do">更多...</a>';
        $('#portlet-demo').portlet({
            sortable: true,
            create: function() {
                //alert('created portlet.');
            },
            removeItem: function() {
                //alert('after remove');
            },
            columns: [{
                width: 480,
                portlets: [{
                    attrs: {
                        id: 'feeds'
                    },
                    title: '开睿新闻',
                    icon: 'ui-icon-signal-diag',
                    content: {
                        //设置区域内容属性
                        style: {
                            height: '200px'
                        },
                        type: 'text',
                        text: str,
                        beforeShow: function(aa) {
                            //alert('before show, content is: ' + aa);
                        },
                        afterShow: function() {
                            //alert('after show');
                        }
                    },
                    scripts: ['loaded-by-portlet.js']
                }]
            }]
        });
		});
	</script>
</head>
<body>
	<div id='portlet-demo' ></div>
</body>
</html>